#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : Lee
# @File    : write_csv.py
# @Time    : 2023/12/12 17:09
import csv
import math
import numpy as np

if __name__ == '__main__':
    theta = np.radians(-45)
    rotation_matrix = np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]])

    _data = list()
    for i in range(1000):
        rotated_vertices = np.dot(np.array([i / 10 - 50, 5 * math.sin(i/100)]), rotation_matrix)
        _data.append([i, round(float(rotated_vertices[0]), 8), round(float(rotated_vertices[1]), 6)])

    with open("data/test_data.csv", 'w', newline='') as file:
        writer = csv.writer(file)
        writer.writerows(_data)
